package cn.kgc.kgceruekauserconsumer.client;

import cn.kgc.kgceruekauserconsumer.fallback.RestUserServiceClientFallback;
import cn.kgc.pojo.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author geQiang
 * @version 1.0
 * @date 2019/4/13
 * @description cn.kgc.kgceruekauserconsumer.client
 */
@FeignClient(name = "kgc-eureka-user-provider", fallback = RestUserServiceClientFallback.class)
public interface RestUserServiceCilent {

    @RequestMapping("/login")
    public String login(
            @RequestParam(value = "username", defaultValue = "", required = false) String username,
            @RequestParam(value = "password", defaultValue = "", required = false) String password
    );

    @RequestMapping(value = "/loginByUser", method = RequestMethod.POST)
    public User loginByUser(@RequestBody User user);
}
